<?php
namespace app\portal\controller;

use cmf\controller\HomeBaseController;
use app\portal\model\PortalCategoryModel;
use think\Db;
use app\admin\model\ThemeModel;


class CategoryController extends HomeBaseController
{
    public function index()
    {
        $cid = $this->request->param('id');
        $page = $this->request->param('page');
        $postService = new PostService();

        if (!$cid) {
            abort(404, '文章类别不存在!');
        }
        $articles = $postService->publishedCategory($cid, $page);
        
    }

    public function list()
    {
        $categoryModel = new PortalCategoryModel();
        $result = $categoryModel->field('id,name')->select();
        print_r($result);
        exit;
    }
}